package com.edu.dao;

import java.sql.Timestamp;
import java.util.List;

import com.edu.entiy.Book;
import com.edu.entiy.History;
import com.edu.entiy.User;

public interface HistoryDao {
	//查询所有借阅记录
	List<History> selectAll();
	//添加图书借阅记录
	int addHistory(History history);
	//查询所有借阅记录的条数
	int selectHistoryCount(Integer userId,Integer status);
	//分页查询
	List<History> selectHistoriesByPage(int begin,int size,Integer userId,Integer status);
	//根据借书表的id修改借书表信息
	int updateHistory(History history);
	//根据借书表的id查找借书信息
	History selectHistoryById(int id);
	//还书
	boolean returnBook(History history,Book book,User user);
	//修改借阅表的最迟归还时间
	void updateHistoryEndTime(Timestamp endTime,int historyId);
	//根据书籍id查询
	History selectByBookId(int bookId);
	//根据书籍类型id查询
	History selectByCard(int card);
	//根据userId查询用户
	History selectByuserId(int userId);
	
}
